<template>
    <a-modal v-model:visible="visible" draggable :mask-closable="false" :hide-cancel="true">
        <template #title>
            查看服务器配置
        </template>
        <div>
            dispatcher配置信息：
            <div style="white-space:pre-wrap;height:400px;overflow-y: auto;background-color:#eef0f5;padding:10px;font-size:12px;"
                v-html="serverConfigContent">
            </div>
        </div>
    </a-modal>
</template>
<script>
export default {
    data() {
        return {
            visible: false,
            serverConfigContent: ''
        }
    },
    methods: {
        init() {
            this.visible = true;
            this.$nextTick(() => {
                this.getInfo()
            })
        },
        getInfo() {
            this.$http.get("/api/dispatcher/serverConfig").then(({ data: res }) => {
                if (res.code !== 0) {
                    Modal.message({ message: res.msg, status: 'error' })
                    return
                }
                this.serverConfigContent = res.data
            }).catch(() => { })
        },
    }
}
</script>